/*
 *Create By：Z.B
 *@DATE 2019/3/18 10:24
 *@EMAIL: 2545375@qq.com
 */
'use strict';
module.exports = app => {
  const mongoose = app.mongoose;

  const UserSchema = new mongoose.Schema({
    mobile: {type: String,required: true,unique: true,trim: true},
    account: {type: String,required: true,unique: true,trim: true},
    password: {type: String, required: true,trim: true},
    realName: {type: String,required: true,trim: true},
    role: { type: mongoose.Schema.Types.ObjectId,ref: 'Role'},
    extra: {type: mongoose.Schema.Types.Mixed},
    createAt: {type: Date, default: Date.now}
});
  return mongoose.model('User',UserSchema);
};